function query() {
	$.ajax({
		url : base + "/sale/query",
		success : function(data) {
			console.log(data.map);
			var htmlStr = "<tr><th>订单编号</th><th>订单详情</th><th>下单时间</th><th>总额(元)</th><th>顾客付款额(元)</th><th>操作人员</th><th>是否已支付</th></tr>";
			
			if(data.list.length > 0) {
				for(var i = data.list.length - 1; i >= 0; i--) {
					var products = "";
					for(var j = 0; j < data.list[i].products.length; j++) {
						products += data.list[i].products[j].productName +
						"&nbsp;[&nbsp;价格：" + data.list[i].products[j].money.amount + "元,&nbsp;数量：" + data.map[data.list[i].orderId + "-" +
						               data.list[i].products[j].productId] + "&nbsp;]" + "<br/>";
					}
					htmlStr += "<tr><td>" + data.list[i].orderId + "</td><td>" +
							products + "</td><td>" +
							data.list[i].orderDate + "</td><td>" +
							data.list[i].totalAmount.amount + "</td><td>" +
							data.list[i].customerPay.amount + "</td><td>" +
							data.list[i].employee.name + "</td><td>" +
							(data.list[i].isPay == false? "否":"是") + "</td></tr>";
				}
			}
			$("#orders").html(htmlStr);
		}
	});
}

function init() {
	query();
}